import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.junit.jupiter.api.Test;

@SpringBootTest
public class OrderServiceTest {

    @Autowired
    private OrderService orderService;

    @Test
    public void testAdd() {
        try {
            orderService.add("苹果", 5);
        } catch (Exception e) {
            System.out.println(e.getMessage());
        }
    }

    @Test
    public void testDelete() {
        try {
            orderService.delete("香蕉");
        } catch (Exception e) {
            System.out.println(e.getMessage());
        }
    }

    @Test
    public void testFind() {
        int count = orderService.find("橙子");
        System.out.println("查询结果: " + count);
    }
}
